package behaviorType.mediator;

public class Guest {
    private boolean free;

    private Mediator med; // 无论是主播还是评论员都要通过中介对象执行操作

    public Guest(Mediator md) {
        this.med = md;
    }

    public boolean isFree() {
        return free;
    }

    public void setFree(boolean free) {
        this.free = free;
    }

    // 通过中介者开始说话
    public void speak() {
        med.guestSpeak();
    }

    // 通过中介者停止说话
    public void stop() {
        med.guestStop();
    }
}